<%--
  Created by IntelliJ IDEA.
  User: blake
  Date: 2016/7/28
  Time: 14:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib uri="http://www.rapid-framework.org.cn/rapid" prefix="rapid" %>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath }/css/common01.css"/>
    <title>用户管理</title>
    <script type="text/javascript">
        function deleteItems(){
            document.itemsForm.action="${pageContext.request.contextPath }/Customer/deleteCustomers.action";
            document.itemsForm.submit();
        }


    </script>

</head>
<body>


<div class="container clearfix">
    <rapid:override name="main_wrap">
        <form name="itemsForm"
              action="${pageContext.request.contextPath }/Customer/findCustomerByName.action" method="post"
              id="itemsForm">
            <table width="100%" border="1">
                <tr>
                    <td>用户名称:
                        <input type="text" name="customerName"
                               value=""/></td>
                    <td>
                        <input type="submit" value="查询"/>
                        <input type="button" value="批量删除"
                               onclick="deleteItems()"/>
                    </td>
                </tr>
            </table>

        <table class="main_wrap_table" id="customers">
            <tr>
                <td>选择</td>
                <td>用户id</td>
                <td>用户名称</td>
                <td>用户电话</td>
                <td>用户邮箱</td>
                <td>状态</td>
                <td>操作</td>
            </tr>
            <c:forEach items="${list}" var="lists">
                <tr>
                    <td><input type="checkbox" name="customersId"
                               value="${lists.customerId }"></td>
                    <td>${lists.customerId}</td>
                    <td>${lists.fullName}</td>
                    <td>${lists.telephoneNum}</td>
                    <td>${lists.eEmail}</td>
                    <td id="status" class="status_c">
                        <c:choose>
                            <c:when test="${lists.sStatus == 0}">
                                正常状态
                            </c:when>
                            <c:otherwise>
                                已被封号
                            </c:otherwise>
                        </c:choose>
                    </td>
                    <td><a
                            href="${pageContext.request.contextPath }/Customer/deleteCustomerById.action?id=${lists.customerId}&page=${currentPage}">删除
                    </a> | <a
                            href="${pageContext.request.contextPath }/Customer/returnCustomerInfo.action?id=${lists.customerId}">详情
                    </a> | <a
                            href="${pageContext.request.contextPath }/Customer/changeCustomerStatus.action?page=${currentPage}&status=${lists.sStatus}&id=${lists.customerId}" class="status_class" id="status_click">
                        <c:choose>
                            <c:when test="${lists.sStatus == 0}">
                                封号
                            </c:when>
                            <c:otherwise>
                                解封
                            </c:otherwise>
                        </c:choose>
                    </a>
                    </td>
                </tr>
            </c:forEach>
        </table>
        </form>
        <div id="page">
            <ul>
                <li class="first"><a
                        href="${pageContext.request.contextPath}/Customer/returnCustomerInfos.action?page=1">&nbsp;首页&nbsp;</a></li>
                <li class="upPage"><a
                        href="${pageContext.request.contextPath}/Customer/returnCustomerInfos.action?page=<c:choose>
                        <c:when test="${currentPage == 1}">
                        ${1}
                        </c:when>
                        <c:otherwise>
                        ${currentPage-1}
                        </c:otherwise>
                        </c:choose>
                ">&nbsp;上一页&nbsp;</a></li>
                <li class="nextPage"><a
                        href="${pageContext.request.contextPath}/Customer/returnCustomerInfos.action?page=<c:choose>
                <c:when test="${list.size() < 8}">
                ${currentPage}
                </c:when>
                <c:otherwise>
                ${currentPage+1}
                </c:otherwise>
                </c:choose>
                ">&nbsp;下一页&nbsp;</a></li>
                <li class="lastPage"><a href="#">&nbsp;末页&nbsp;</a></li>
            </ul>
        </div>

    </rapid:override>
</div>

</body>
</html>
<%@include file="../common/templateJSP.jsp"%>
